<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<c:forEach items="${resume.awardList}" var="award">
    <c:if test="${!empty award}">
        <div class="award_info">
                <span><b>${award.name}</b></span>
                <span>&nbsp|&nbsp</span>
                <span class="award_time"><fmt:formatDate value="${award.awardTime}" pattern="yyyy/MM/dd"/></span></br>

            <div class="button_edit">
                <button type="button" value="${award.id}" id="button_award_edit_${award.id}"
                onclick="award_edit(this.value)">编辑</button>
            </div>
            <div class="button_del">
                <button type="button" value="${award.id}"  id="button_award_del_${award.id}"
                        onclick="award_del(this.value)">删除</button>
            </div>
        </div>
    </c:if>
</c:forEach>
<script>
    // $("#button_award_edit").click(function () {
    function award_edit(obj){
        // let resumeId = $("#resumeId").val();
        $("#award_edit").load("/hire/resume/award_edit_update", {id: obj});
        $("#award_info").hide();
        $("#award_edit").show();
    // })
    }
    // $("#button_award_del").click(function () {
    function award_del(obj){
        let resumeId = $("#resumeId").val();
        $.post('/hire/resume/award/delete',{awardId:obj},function (res) {
            if (res.code == '200') {
                $("#award_info").load("/hire/resume/award_info", {id: resumeId});
                $("#award_edit").hide();
            } else {
                layer.msg("删除失败")
            }
        })
    }
    // })
</script>